<template>
  <div id="records">  

     <el-form ref="form"  label-width="80px">           
          <el-row>
            <el-col :span="12" >  
                <div style="height:38px;line-height:38px;width:150px;"> 
                  <i class="el-icon-back" @click="goBack"></i> 
                  {{ $route.query.name }} 
                </div> 
            </el-col>
          </el-row>
    </el-form>

   <!-- 渲染数据list -->
   <records-list :recordsdata="recordsdata" > </records-list>

      
   <div style="margin-top:20px;text-align: center;">
      <el-pagination
        background
        @current-change="handleCurrentChange"
        :page-size="10"  
        layout="prev, pager, next, jumper"
        :total="count">
      </el-pagination>
    </div>

    

      
  </div>
</template>

<script>
import RecordsList from '@/view/Member/RecordsList'
export default {
  name: 'records',
  data () {
    return {
        recordsdata:[],
        page:1,
        count:0,
    }
  },
 components:{
    RecordsList
  },
  created(){
       this.lode_fun()
  },
  mounted (){
    
  },
  methods: {
     lode_fun(){
        this.post("/goods/distributeLog", {
            toUid:this.$route.query.id,
            page:this.page
        }).then(res => {  
            //console.log(res)
            this.count = res.result.count
            this.recordsdata = res.result.list

        })
     },
     goBack() {
        this.$router.go(-1)
    },
     handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.page = val
        this.lode_fun()
        console.log(`当前页: ${val}`);
      }
  }
}
</script>


<style scoped>
</style>
